import { expect } from 'chai';
import promisify from '../src/promisify.js';

describe('promisify test suite', function() {

    function foo(params) {
        if (params && params.success) {
            params.success(1234);
        }
    }

    it('should return a promise', function(done) {
        const newFoo = promisify(foo);
        newFoo().then(res => {
            expect(res).to.be.equal(1234);
            done();
        });
    });
})